/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ws1.exo2.domain;

import java.io.Serializable;

/**
 *
 * @author johann
 */
public class Item implements Serializable {

    private String name;
    private String type;
    
    public Item(String name, String type) {
        this.name = name;
        this.type = type;
    }
    
    @Override
    public boolean equals(Object o) {
        Item it = (Item)o;
        if(this.name.equals(it.getName())) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public int hashCode() {
        int result;
        result = getType().hashCode();
        result = 29 * result + getName().hashCode();
        return result;

        
        
        /*int hash = 7;
        hash = 37 * hash + (this.name != null ? this.name.hashCode() : 0);
        hash = 37 * hash + (this.type != null ? this.type.hashCode() : 0);
        return hash;*/
    }
    
    
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}
